﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Runtime.InteropServices.Automation;

namespace Cd
{
	public static class SilverlightContainer
	{
		private static dynamic silverlightContainer_;
		static SilverlightContainer()
		{
			try
			{
				silverlightContainer_ = AutomationFactory.CreateObject("");
			}
			catch(Exception)
			{
			}
		}
		public static void Close()
		{
			silverlightContainer_.Close();
		}
		public static void NewWindow( UIElement rootElement )
		{
			silverlightContainer_.NewWindow();
		}
		public static void Quit()
		{
			MessageBox.Show("Sending the quit command.");
			silverlightContainer_.Quit();
		}
	}
}